<?php
/**
 * @Author: kendy
 * @Date:   2019-11-07 17:03:13
 * @Last Modified by:   jiayanting
 * @Last Modified time: 2019-11-08 08:38:18
 */
namespace app\common\model;
use think\Model;
use think\Db; 
class HotelOrderListModel extends Model
{

    public function makeOrderList($linkmanArr,$orderId,$hotel_id)
    {

    	if(count($linkmanArr)>0)
    	{ 
    		foreach ($linkmanArr as $k => $v) { 
    		//创建酒店订单用户记录
			 $orderList = [];
			 $orderList['order_id'] = $orderId;
			 $orderList['username'] = $v; 
             $orderTotalList[] = $orderList;
			 //增加总的销售量
			 Db::name('hotel')
			 ->where(['hotel_id'=>$hotel_id,'is_del'=>0,'is_pass'=>1])
			 ->setInc('sum_sale',1);
    		}
            $result = Db::name('hotel_orderlist')->insertAll($orderTotalList);   
    	}
    }
}
